package com.itheima.inputstreamreader;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.Reader;

public class Test1 {

    public static void main(String[] args) {

        try (
                //1.创建文件字符输入流对象与文件接通
                //Reader reader = new FileReader("io\\src\\poem.txt");
                Reader reader = new FileReader("io\\src\\poem_gbk.txt");    //乱码
                //2.创建缓冲字符输入流对象包装低级的字符输入流对象
                BufferedReader br = new BufferedReader(reader);
        ) {

            String line;
            while ((line = br.readLine()) != null) {
                System.out.println(line);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
